<template>
  <div>
    nexttick测试
    <input type="text" v-show="flag" ref="inp" />
    <el-dialog
      title="提示"
      v-dialogdrag
      :visible.sync="box"
      :class="{ 'avue-dialog': type == 0 }"
      width="40%"
    >
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="box = false">取 消</el-button>
        <el-button type="primary" @click="box = false">确 定</el-button>
      </span>
    </el-dialog>
    <el-button @click="openBox(1)">原生el样式弹窗</el-button>
    <el-button type="primary" @click="openBox(0)">avue样式弹窗</el-button>

    <el-button @click="fn">复制</el-button>
    <div>
      <h2>vuex模块</h2>
      模块1 {{ $store.state.moduleA.modA }} <br />
      模块2
      {{ $store.state.moduleB.modB }}
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag: false,
      num: 100,
      type: '',
      box: false
    }
  },
  created() {
    console.log(this.$attrs)
    console.log(this.$listeners)
  },
  methods: {
    openBox(type) {
      this.type = type
      this.box = true
    },
    fn() {
      this.$Clipboard({
        text: '复制的文本内容'
      })
        .then(() => {
          this.$message.success('复制成功')
        })
        .catch(() => {
          this.$message.error('复制失败')
        })
    }
  }
}
</script>

<style lang="less" scoped></style>
